package top.ajunnihao.core.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.ajunnihao.core.entity.UserAbility;
import top.ajunnihao.core.mapper.UserAbilityMapper;
import top.ajunnihao.core.service.UserAbilityService;

/**
 * TODO 用户权限业务层接口实现类
 *
 * @author AJun
 * @version 1.0.0
 * @date 2020/5/24
 */
@Service("userAbilityService")
public class UserAbilityServiceImpl implements UserAbilityService {

    @Autowired
    private UserAbilityMapper userAbilityMapper;

    @Override
    public UserAbility findUserAbilityByUserId(Integer userId) {
        return userAbilityMapper.findUserAbilityByUserId(userId);
    }

    @Override
    public boolean saveUserAbility(UserAbility userAbility) {
        return userAbilityMapper.saveUserAbility(userAbility) > 0;
    }

    @Override
    public boolean updateUserAbility(UserAbility userAbility) {
        return userAbilityMapper.updateUserAbility(userAbility) > 0;
    }

}
